import request from '@/config/axios'

export interface ReportVO {
    id?: number
    proId?: number,
    stuId?: number,
    expContent?: string,
    score?: string,
    conclusion?: string,
    teaSum?: string,
    tutor?: string
}

export interface DelVO {
    id?: number,
    ids?: number[]
}



// 分页查询实验室
export const getLaboratoryPage = (data: PageParam) => {
    return request.post({url: '/laboratory/query', data})
}
// 查询实验室
export const getLaboratory = (id: number) => {
    return request.get({url: '/laboratory/queryById/' + id})
}

//ID查询实验室占位情况
export const getLaboratoryPlaceById = (code: number,weekId: number) => {
    return request.get({url: '/laboratory/query/free?code=' + code+'&weekId='+weekId})
}

// 添加实验室
export const addLaboratory = async (data: ReportVO) => {
    return await request.post({url: '/laboratory/add', data})
}

// 删除实验室
export const deleteLaboratory = async (data: any) => {
    return await request.delete({url: '/laboratory/delete', data})
}

// 修改实验室
export const updateLaboratory = async (data: ReportVO) => {
    return await request.put({url: '/laboratory/edit', data})
}

// 查询实验室类型列表
export const getLaboratoryTypeList = async (data: PageParam) => {
    return await request.get({
        url: `/system/dict-data/page?pageNo=${data.pageNo}&pageSize=${data.pageSize}&dictType=${data.dictType}`, data})
}

// 查询实验室类型列表
export const getCurrentAppointment = (data: PageParam) => {
  return request.post({url: '/laboratory/getHasApproval', data})
}

// 查询实验室类型列表
export const cancelAppointment = (data: PageParam) => {
  return request.post({url: 'laboratory/cancel', data})
}


